package com.atguigu.gmall.all.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author luhan
 * @create 2022/5/21 16:25
 */
@Controller
public class PassportController {

    // http://passport.gmall.com/login.html?originUrl=http://passport.gmall.com/
    @GetMapping("login.html")
    public String login(HttpServletRequest request){
        // 获取到路径
        String originUrl = request.getParameter("originUrl");
        // 当用户在某个URL中点击登录，用户输入正确的用户名和密码，点击登录成功之后，回跳到原来的URL
        request.setAttribute("originUrl",originUrl);
        return "login";
    }
}
